package com.boyunv.command.example01;
/*
 *@description
 *
 *@author boyunv
 *@create 2023/9/7 7:42
 *@version 1.0
 */

import java.sql.Wrapper;

public class Client {
    public static void main(String[] args) throws InterruptedException {
        Order order = new Order();
        order.setDiningTable(10);
        order.getFoodMenu().put("暴雨炒饭",1);
        order.getFoodMenu().put("暴雨00炒面",1);
        
        
        Order order2= new Order();
        order2.setDiningTable(10);
        order2.getFoodMenu().put("黄焖鸡米饭",1);
        order2.getFoodMenu().put("银耳汤",1);
        
        
        //创建接受者
        Chef chef = new Chef();
        //将订单和接受者对象封装成命令对象
        OrderCommand cmd1 = new OrderCommand(chef, order);
        OrderCommand cmd2 = new OrderCommand(chef, order2);
        
        //创建调用者
        Waiter waiter = new Waiter();
        waiter.setCommands(cmd1);
        waiter.setCommands(cmd2);
        
        //将订单发送给厨师   上菜
        waiter.orderUp();
    }
}
